package BanyuanClub.Work.Story.One;

public class Rectangle extends Shape{
    private double height;
    private double width;


    public Rectangle(String color, int height, int width) {
        super(color);
        this.height = height;
        this.width = width;
    }

    @Override
    public double getArea() {
         return this.width*this.height;
    }

    @Override
    public double getPer() {
        return 2*(this.height + this.width);
    }

    @Override
    public void showAll() {
        System.out.println("height="+this.height+",width="+this.width+
                ",Area="+this.getArea()+",per="+this.getPer()+",color="+this.getColor());
    }
}
